package view;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import model.Model;
import tcp.Server;


/**
 * 
 * 
 * @date 19.03.2013
 * @author rs
 * @version
 * 
 */
public class Main {

	private JFrame frmHaupt;
	
	private Model model;
	
	private Server server;
	
	private JPanel pnlAnzeige;

	/**
	 * Konstruktor
	 */
	public Main() {

		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {

			e.printStackTrace();
		}

		frmHaupt = new JFrame("Simulation TCP Server");
		frmHaupt.addWindowListener(new FensterVerwaltung(frmHaupt));	
		
		model = new Model();
		
		server = new Server(model);
		
		pnlAnzeige = new Anzeige(model);
		
		frmHaupt.add(pnlAnzeige);
		
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				frmHaupt.pack();
				frmHaupt.setVisible(true);
				frmHaupt.setLocationRelativeTo(null);
			}
		});

	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new Main();

	}

}
